import java.lang.reflect.Proxy;

public class Client {
	public static void main(String args[]) {
		Car car = new Cars("1");
		// this is responsable to load classes
		ClassLoader loader = Car.class.getClassLoader();
		//Proxy provides static methods for creating dynamic proxy classes and instances, 
		//and it is also the superclass of all dynamic proxy classes created by those method
		//newProxyInstance - Returns an instance of a proxy class for the specified interfaces that dispatches
		//method invocations to the specified invocation handler
		Car c = (Car) Proxy.newProxyInstance(loader, new Class[] {Car.class}, new CarHandler((Cars) car));
		c.color();
		c.run();
		c.type();
	}

}
